﻿using System;
using DataBroker.Criteria;
using NUnit.Framework;
using DataBroker.Dal;
using OraHRDAO;

namespace D2BkTest
{
    [TestFixture]
    public class OracleHRTest
    {
        [SetUp]
        public void SetUp()
        {
            D2Bk.ChangeDatabase("Hr");
        }
        [Test]
        public void SelectFromEmp()
        {
            var emp = D2Bk.Fetch(new Filter(), new EMPLOYEES());
        }
        [Test]
        public void SelectFromEmpAndManagers()
        {
            var emp = D2Bk.Fetch(new Filter(), new EMPLOYEES(new MANAGERS()));
        }
        [Test]
        public void SelectFromManagersAndEmp()
        {
            var emp = D2Bk.Fetch(new Filter(), new MANAGERS(new EMPLOYEES()));
        }
        /// <summary>
        /// Calling Oracle stored procedure.
        /// </summary>
        [Test]
        public void AddJobHistory()
        {
            D2Bk.ExecuteSP("ADD_JOB_HISTORY", 123, DateTime.Today, DateTime.Today.AddYears(1), "SA_MAN", 10);
        }
    }
}
